﻿namespace ClassyBlog.Web.Specs.Unit
{
    using Machine.Specifications;

    [Subject(typeof(PagedList<object>))]
    public class when_paged_list_is_created
    {
        static PagedList<object> pagedList;
        static int pageCount;

        Establish context = () =>
            pagedList = new PagedList<object>(1, 100, 10, new object[0]);

        Because of = () => pageCount = pagedList.PageCount;

        It should_have_correct_page_count = () => pageCount.ShouldEqual(10);

        It should_indicate_whether_it_can_move_previous = () =>
            pagedList.CanMovePrevious.ShouldBeFalse();

        It should_indicate_whether_it_can_move_next = () =>
            pagedList.CanMoveNext.ShouldBeTrue();
    }
}